<template>
  <view class="container">
    <view class="list">
      <view class="item" v-for="index in 3" :key="index" @click="gostudentdetail">
        <view class="top">
          <!-- 头像 -->
          <image src="../../static/img/mybgc.png" mode="aspectFill" style="width: 186rpx; height: 186rpx; border-radius: 20rpx"></image>
          <!-- 信息 -->
          <view class="topright">
            <view class="right">
              <view style="font-size: 30rpx; font-family: PingFang SC, PingFang SC; font-weight: bold; color: #222222">李同学</view>
              <image src="../../static/icon/nv.png" mode="aspectFill" style="width: 42rpx; height: 42rpx; margin: 0 4rpx"></image>
              <view class="school">第五实验中学</view>
            </view>
            <view style="font-size: 26rpx; font-family: PingFang SC, PingFang SC; font-weight: 500; color: #222222; margin: 12rpx 0 40rpx 0">初三 | 数学</view>
            <view style="font-size: 28rpx; font-family: PingFang SC, PingFang SC; font-weight: 500; color: #222222">已授课程120/120</view>
          </view>
        </view>
        <!-- 按钮 -->
        <view class="bottom">
          <view class="checkbtn" @click="gocheckgrades">查看成绩</view>
          <view class="savebtn" @click="gosavework">留作业</view>
          <view class="savebtn" @click="gocheckwork">查看作业</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    // 跳转到查看我的成绩
    gocheckgrades() {
      uni.navigateTo({
        url: '/sub_user/checkgrades/checkgrades'
      });
    },
    // 跳转到留作业
    gosavework() {
      uni.navigateTo({
        url: '/sub_user/savework/savework'
      });
    },
    // 跳转到查看作业
    gocheckwork() {
      uni.navigateTo({
        url: '/sub_user/checkwork/checkwork'
      });
    },
    // 跳转到我的学生详情
    gostudentdetail() {
      uni.navigateTo({
        url: '/sub_user/studentdetail/studentdetail'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.container {
  box-sizing: border-box;
  .list {
    box-sizing: border-box;
    .item {
      box-sizing: border-box;
      width: 710rpx;
      height: 320rpx;
      background: #fff;
      margin: 20rpx;
      padding: 20rpx;
      border-radius: 20rpx 20rpx 20rpx 20rpx;
      .top {
        display: flex;
        .topright {
          margin-left: 20rpx;
          .right {
            display: flex;
            .school {
              box-sizing: border-box;
              font-size: 22rpx;
              font-family: PingFang SC, PingFang SC;
              font-weight: 500;
              width: 172rpx;
              height: 40rpx;
              background: #eaedfd;
              border-radius: 10rpx 10rpx 10rpx 10rpx;
              color: #3553e8;
              text-align: center;
              line-height: 40rpx;
              text-overflow: ellipsis;
              white-space: nowrap;
              overflow: hidden;
            }
          }
        }
      }
      .bottom {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-top: 30rpx;
        .checkbtn {
          box-sizing: border-box;
          width: 140rpx;
          height: 52rpx;
          text-align: center;
          line-height: 52rpx;
          background: #ffffff;
          border-radius: 100rpx 100rpx 100rpx 100rpx;
          color: #3553e8;
          font-size: 26rpx;
          font-family: PingFang SC, PingFang SC;
          font-weight: 500;
          border: 2rpx solid #3553e8;
          margin-right: 20rpx;
        }
        .savebtn {
          box-sizing: border-box;
          width: 140rpx;
          height: 52rpx;
          text-align: center;
          line-height: 52rpx;
          background: #3553e8;
          border-radius: 100rpx 100rpx 100rpx 100rpx;
          color: #fff;
          font-size: 26rpx;
          font-family: PingFang SC, PingFang SC;
          font-weight: 500;
        }
      }
    }
  }
}
</style>
